
// 函数防抖
function debounce(fn,delay=2000){
    // 定义一个定时器
    let timer = null
    return function(){
        let _this = this
        let params = arguments
        clearTimeout(timer)
        timer = setTimeout(() => {
            timer = null
            fn.call(_this,params)
        }, delay);
    }
}

export{
    debounce
}